#include <2025Linux.h>
int main(int argc, char *argv[])
{
    // ./03_redirect file2
    ARGS_CHECK(argc,2);
    int fd = open(argv[1],O_RDWR);
    ERROR_CHECK(fd,-1,"open");
    printf("\n");//避免某些os的bug close(1)之前打印一下
    dup2(fd,STDOUT_FILENO);
    dup2(fd,STDERR_FILENO);

    printf("Hello\n");
    fprintf(stderr,"World\n");
    return 0;
}

